package cn.yuanqiao.common.core.domain.entity;

import com.fasterxml.jackson.annotation.JsonInclude;

import java.util.List;
import java.util.stream.Collectors;

public class DeptTreeSelect {
    private static final long serialVersionUID = 1L;

    /** 节点ID */
    private Long id;

    /** 节点名称 */
    private String deptName;

    private Long parentId;

    private Integer orderNum;

    private String delFlag;


    private String status;

    /** 子节点 */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<DeptTreeSelect> children;



    public DeptTreeSelect(SysDept dept)
    {
        this.id = dept.getDeptId();
        this.deptName = dept.getDeptName();
        this.parentId=dept.getParentId();
        this.orderNum=dept.getOrderNum();
        this.delFlag=dept.getDelFlag();
        this.status=dept.getStatus();
        this.children = dept.getChildren().stream().map(DeptTreeSelect::new).collect(Collectors.toList());
    }

    public DeptTreeSelect(SysUser sysUser) {
    }


    public Long getId()
    {
        return id;
    }

    public void setId(Long id)
    {
        this.id = id;
    }


    public List<DeptTreeSelect> getChildren()
    {
        return children;
    }

    public void setChildren(List<DeptTreeSelect> children)
    {
        this.children = children;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Integer getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }
}
